/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package master.proyectoweb.managedbeans;

import java.io.Serializable;
import java.util.Locale;
import javax.inject.Named;
import javax.enterprise.context.SessionScoped;
import javax.faces.context.FacesContext;

/**
 *
 * @author joaquin
 */
@Named("languageController")
@SessionScoped
public class LanguageController implements Serializable {

    private final Locale spanish;
    /**
     * Creates a new instance of languageController
     */
    public LanguageController() {
        spanish = Locale.getDefault();
    }
    
    public String setEnglishLang() {
        FacesContext.getCurrentInstance().getApplication().setDefaultLocale(Locale.ENGLISH);
        return "#";
    }
    
    public String setSpanishLang() {
        FacesContext.getCurrentInstance().getApplication().setDefaultLocale(spanish);
        return "#";
    }
    
}
